/**
 * @author Lenovo
 * @date 2022/3/7
 */
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import javax.imageio.IIOException;
import javax.imageio.ImageIO;
import javax.swing.*;

@SuppressWarnings("serial")
public class Splash extends JFrame{
    BufferedImage startImg = null;
    public Splash() {
        try {
//            startImg = ImageIO.read(new File(GameUtil.GAME_START_ICON_PATH));
            URL imgUrl = Test.class.getResource(GameUtil.GAME_START_ICON_PATH);
            assert imgUrl != null;
            startImg = ImageIO.read(imgUrl);

            setUndecorated(true);
            setSize(startImg.getWidth(), startImg.getHeight());
            setLocationRelativeTo(null);
            setVisible(true);
        } catch (IOException e){
            e.printStackTrace();
        }
    }
    public void paint(Graphics g) {
        g.drawImage(startImg, 0, 0, this);
    }
}



